var AnswerHelper = {
    SetExamSubmit(examsub) {
        examsub.BeginInterval = new Date().getTime()
        window.ExamSubmit = examsub
    },

    SetAnswer(answer) {
        console.log(answer)
        window.Test = window.Test || {}
        window.Test[answer.TestID] = window.Test[answer.TestID] || []
        var existAnswer = false
        for (var i in window.Test[answer.TestID]) {
            existAnswer = answer.StemID == window.Test[answer.TestID][i].StemID
            if (existAnswer) {
                window.Test[answer.TestID][i] = answer
                break
            }
        }
        if (!existAnswer)
            window.Test[answer.TestID].push(answer)
    },

    SetStuActionRecord(opts) {
        var opts = GetStuActDto(opts);
        //向服务器提交用户行数数据
        // $.ajax({
        //     type: "POST",
        //     url: "http://" + opts.ServerIP + ":8734/AddStudentAction",
        //     dataType: 'json',
        //     data: JSON.stringify(opts),
        //     success: function (d) {
        //        // alert($.parseJSON(d).data);
        //     }
        // });
    },
    ReSetAnswer() {
        window.Test = {}
        window.ExamSubmit = {}
    }
}
export default AnswerHelper